<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // const map = new Map();
        // 设置。添加
        // map.set("name","张三");
        // map.set("age",10);
        // console.log(map.delete("name"));
        // map.clear()
        // console.log(map.get("name"));
        // console.log(map.has("name"));

        //新的定义map的方法
        const  map2 = new Map([
            ["name","张三"],
            ["age",10]
        ])
        console.log(map2);
        // 遍历
        map2.forEach((v,k) => {
            console.log(k,v);
        });

    </script>
</body>
</html>